home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / MPW Oberon 2.1168 / OInterfaces / Dictionary.mod < prev    next >
Encoding:
Text File  |  1995-08-10  |  4.1 KB  |  118 lines  |  [TEXT/MPS ]

  1. (*
  2.      File:        Dictionary.mod
  3.  
  4.      Contains:    Dictionary Manager Interfaces
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs.applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. *)
  19.  
  20. (*$TAGS-*)
  21. (*$CALLING PASCAL*)
  22. MODULE Dictionary;
  23.  
  24. IMPORT SYSTEM, Types, Files;
  25.  
  26. (* $PUSH*)
  27. (* $ALIGN MAC68K*)
  28. (* $LibExport+*)
  29.  
  30. CONST
  31. (* Dictionary data insertion modes *)
  32.     kInsert*                        = 0;                            (* Only insert the input entry if there is nothing in the dictionary that matches the key. *)
  33.     kReplace*                    = 1;                            (* Only replace the entries which match the key with the input entry. *)
  34.     kInsertOrReplace*            = 2;                            (* Insert the entry if there is nothing in the dictionary which matches the key. 
  35.                            If there is already matched entries, replace the existing matched entries with the input entry. *)
  36.  
  37. (* This Was InsertMode *)
  38.     
  39. TYPE
  40.     DictionaryDataInsertMode* = INTEGER;
  41.  
  42.  
  43. CONST
  44. (* Key attribute constants *)
  45.     kIsCaseSensitive*            = $10;                            (* case sensitive* = 16        *)
  46.     kIsNotDiacriticalSensitive*    = $20;                            (* diac not sensitive* = 32    *)
  47.  
  48. (* Registered attribute type constants.    *)
  49.     kNoun*                        = -1;
  50.     kVerb*                        = -2;
  51.     kAdjective*                    = -3;
  52.     kAdverb*                        = -4;
  53.  
  54. (* This Was AttributeType *)
  55.     
  56. TYPE
  57.     DictionaryEntryAttribute* = Types.SInt8;
  58.  
  59. (* Dictionary information record *)
  60.     DictionaryInformation* = RECORD
  61.         dictionaryFSSpec*:        Files.FSSpec;
  62.         numberOfRecords*:        Types.SInt32;
  63.         currentGarbageSize*:        Types.SInt32;
  64.         script*:                    Types.ScriptCode;
  65.         maximumKeyLength*:        Types.SInt16;
  66.         keyAttributes*:            Types.SInt8;
  67.     END;
  68.  
  69.     DictionaryAttributeTable* = (*ΔΔPACKEDΔΔ*) RECORD
  70.         datSize*:                Types.UInt8;
  71.         datTable*:                (*ΔΔPACKEDΔΔ*) ARRAY 1 (*ΔΔ[0..0]ΔΔ*) OF DictionaryEntryAttribute;
  72.     END;
  73.  
  74.     DictionaryAttributeTablePtr* = POINTER TO DictionaryAttributeTable;
  75.  
  76.  
  77. PROCEDURE InitializeDictionary*((*CONST*)VAR theFsspecPtr: Files.FSSpec; maximumKeyLength: Types.SInt16; keyAttributes: Types.ByteParameter; script: Types.ScriptCode): Types.OSErr;
  78.     (*$IF NOT GENERATINGCFM*)
  79.     INLINE PASCAL $303C, $0500, $AA53;
  80.     (*$END*)
  81. PROCEDURE OpenDictionary*((*CONST*)VAR theFsspecPtr: Files.FSSpec; accessPermission: Types.ByteParameter; VAR dictionaryReference: Types.SInt32): Types.OSErr;
  82.     (*$IF NOT GENERATINGCFM*)
  83.     INLINE PASCAL $303C, $0501, $AA53;
  84.     (*$END*)
  85. PROCEDURE CloseDictionary*(dictionaryReference: Types.SInt32): Types.OSErr;
  86.     (*$IF NOT GENERATINGCFM*)
  87.     INLINE PASCAL $303C, $0202, $AA53;
  88.     (*$END*)
  89. PROCEDURE InsertRecordToDictionary*(dictionaryReference: Types.SInt32; key: Types.ConstStr255Param; recordDataHandle: Types.Handle; whichMode: DictionaryDataInsertMode): Types.OSErr;
  90.     (*$IF NOT GENERATINGCFM*)
  91.     INLINE PASCAL $303C, $0703, $AA53;
  92.     (*$END*)
  93. PROCEDURE DeleteRecordFromDictionary*(dictionaryReference: Types.SInt32; key: Types.ConstStr255Param): Types.OSErr;
  94.     (*$IF NOT GENERATINGCFM*)
  95.     INLINE PASCAL $303C, $0404, $AA53;
  96.     (*$END*)
  97. PROCEDURE FindRecordInDictionary*(dictionaryReference: Types.SInt32; key: Types.ConstStr255Param; requestedAttributeTablePointer: DictionaryAttributeTablePtr; recordDataHandle: Types.Handle): Types.OSErr;
  98.     (*$IF NOT GENERATINGCFM*)
  99.     INLINE PASCAL $303C, $0805, $AA53;
  100.     (*$END*)
  101. PROCEDURE FindRecordByIndexInDictionary*(dictionaryReference: Types.SInt32; recordIndex: Types.SInt32; requestedAttributeTablePointer: DictionaryAttributeTablePtr; VAR recordKey: Types.Str255; recordDataHandle: Types.Handle): Types.OSErr;
  102.     (*$IF NOT GENERATINGCFM*)
  103.     INLINE PASCAL $303C, $0A06, $AA53;
  104.     (*$END*)
  105. PROCEDURE GetDictionaryInformation*(dictionaryReference: Types.SInt32; VAR theDictionaryInformation: DictionaryInformation): Types.OSErr;
  106.     (*$IF NOT GENERATINGCFM*)
  107.     INLINE PASCAL $303C, $0407, $AA53;
  108.     (*$END*)
  109. PROCEDURE CompactDictionary*(dictionaryReference: Types.SInt32): Types.OSErr;
  110.     (*$IF NOT GENERATINGCFM*)
  111.     INLINE PASCAL $303C, $0208, $AA53;
  112.     (*$END*)
  113.  
  114. (* $ALIGN RESET*)
  115. (* $POP*)
  116.  
  117.  END Dictionary.
  118.